//////////////////////////////////////////////
///                                        ///
/// PPA-1's CPU                            ///
///                                        ///
/// Released under CERN Open Hardware      ///
/// License                                ///
///                                        ///
/// Marce Coll 2017 - ppa@marcecoll.com    ///
///                                        ///
//////////////////////////////////////////////

`include "ppa1_defines.v"

module ppa1_cpu(
                clk, reset,
                alu_result
                );

   input     reset;
   input     clk;

   parameter data_w = `PPA1_OPERAND_WIDTH;
   parameter addr_w = `PPA1_ADDRESS_WIDTH;

   wire [`PPA1_ALUOP_WIDTH-1:0] alu_op;
   wire [data_w-1:0]            operand_a;
   wire [data_w-1:0]            operand_b;
   wire [data_w-1:0]            instr_bus;
   output [data_w-1:0]          alu_result;

   assign operand_a = 2;
   assign operand_b = 6;

   ppa1_alu ppa1_alu
     (
      .a(operand_a),
      .b(operand_b),
      .alu_op(alu_op),
      .result(alu_result)
      );

   ppa1_control ppa1_control
     (
      .reset(reset),
      .alu_op(alu_op),
      .clk(clk),
      .instr(instr_bus)
      );

   ppa1_instr_reg ppa1_instr_reg
     (
      .clk(clk),
      .instr(instr_bus)
      );

endmodule; // ppa1_cpu
